package com.heima.controller;

import com.heima.dto.pagedto.PageDto;
import com.heima.result.PageResult;
import com.heima.result.Result;
import com.heima.service.NoticeService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@RequestMapping("/system/notice")
public class NoticeController {
    private final NoticeService noticeService;

    /**
     * 根据 status 状态分页查询消息
     * @param status
     * @return
     */
    @GetMapping("/pagelist/{status}")
    public PageResult pageQuery(@PathVariable Integer status) {
        PageResult pageResult = noticeService.pageQuery(status);
        return pageResult;
    }

}
